#!/usr/bin/env python
import json

# 创建一个模拟的但结构完整的名家特征库
data = {
  "王羲之": {
    "style": "running",
    "dynasty": "晋",
    "features": {
      "line_width_variance": 0.85,
      "angle_distribution": 0.78,
      "curvature": 0.82,
      "grid_density": 0.76,
      "center_offset": 0.12,
      "component_distribution": 0.88,
      "fourier_descriptors": [0.05, 0.08, 0.12, 0.15, 0.18, 0.21],
      "structural_complexity": 0.72,
      "wavelet_energy": [0.14, 0.16, 0.18, 0.22, 0.15, 0.08],
      "visual_balance": 0.88,
      "spacing_consistency": [0.9, 0.85],
      "space_utilization": 0.82,
      "margin_ratio": [0.1, 0.08, 0.12, 0.1]
    },
    "description": "东晋书法家，被誉为书圣"
  },
  "颜真卿": {
    "style": "regular",
    "dynasty": "唐",
    "features": {
      "line_width_variance": 0.68,
      "angle_distribution": 0.85,
      "curvature": 0.55,
      "grid_density": 0.82,
      "center_offset": 0.08,
      "component_distribution": 0.85,
      "fourier_descriptors": [0.08, 0.1, 0.15, 0.12, 0.1, 0.08],
      "structural_complexity": 0.65, 
      "wavelet_energy": [0.12, 0.15, 0.2, 0.25, 0.15, 0.08],
      "visual_balance": 0.92,
      "spacing_consistency": [0.95, 0.9],
      "space_utilization": 0.78,
      "margin_ratio": [0.12, 0.1, 0.12, 0.1]
    },
    "description": "唐代书法家，官至太子太师"
  },
  "米芾": {
    "style": "running",
    "dynasty": "宋",
    "features": {
      "line_width_variance": 0.78,
      "angle_distribution": 0.72,
      "curvature": 0.75,
      "grid_density": 0.70,
      "center_offset": 0.14,
      "component_distribution": 0.82,
      "fourier_descriptors": [0.06, 0.09, 0.14, 0.16, 0.12, 0.07],
      "structural_complexity": 0.68,
      "wavelet_energy": [0.13, 0.17, 0.19, 0.21, 0.16, 0.09],
      "visual_balance": 0.86,
      "spacing_consistency": [0.88, 0.83],
      "space_utilization": 0.80,
      "margin_ratio": [0.09, 0.07, 0.10, 0.09]
    },
    "description": "北宋书法家，与苏轼并称苏米，行书著名"
  },
  "柳公权": {
    "style": "regular",
    "dynasty": "唐",
    "features": {
      "line_width_variance": 0.65,
      "angle_distribution": 0.88,
      "curvature": 0.50,
      "grid_density": 0.85,
      "center_offset": 0.06,
      "component_distribution": 0.90,
      "fourier_descriptors": [0.10, 0.12, 0.16, 0.13, 0.09, 0.07],
      "structural_complexity": 0.60,
      "wavelet_energy": [0.11, 0.14, 0.19, 0.26, 0.16, 0.07],
      "visual_balance": 0.95,
      "spacing_consistency": [0.97, 0.93],
      "space_utilization": 0.75,
      "margin_ratio": [0.13, 0.11, 0.13, 0.11]
    },
    "description": "唐代书法家，楷书著名"
  }
}

# 保存到文件
with open('data/master_features.json', 'w', encoding='utf-8') as f:
    json.dump(data, f, ensure_ascii=False, indent=2)

print("名家特征库JSON文件已生成！") 